// 个人中心
import { UserOutlined } from "@ant-design/icons";
import { Avatar, Divider  } from "antd";
import React, { useState } from "react";
import './index.module.scss';
import { storage } from "@/utils/tools"

const personContent = () => {

  const handleOutLogin = () => {
    //如果对接的是中台cloudjsToken
    if(localStorage.getItem("cloudjsToken")){
      const env = import.meta.env.VITE_APP_ENV
      localStorage.clear() 
      if(env==='test'||env==='dev'){
        window.location.href = 'https://admin-uat.028wlkj.com:1020/login';
      }else {
         window.location.href = 'https://admin.028wlkj.com:1020/login';
      }
     }else{
      localStorage.clear() 
      window.location.href = '/login';
     }
  }

const userInfo= JSON.parse(localStorage.getItem("userInfo"))  //中台登录的用户信息


  return (
    <div className="user-box">
      <div className="user-title">
        <Avatar style={{ backgroundColor: "#3f9B6a"}} size="large">{userInfo?.userName.charAt(0)}</Avatar>
        <div className="user-desc">
          <p>{userInfo?.userName}</p>
          <p className="account">账号ID：{userInfo?.userId}</p>
        </div>
      </div>
      {/* <p>
         <a href="#!">
         <UserOutlined className="MR10" />
          账号信息
        </a>
      </p> */}
      {/* <p>
        <a href="#!">
          <UserOutlined className="MR10" />
          实名认证
        </a>
      </p>
      <p>
        <a href="#!">
          <UserOutlined className="MR10" />
          安全设置
        </a>
      </p>
      <p>
        <a href="#!">
          <UserOutlined className="MR10" />
          访问管理
        </a>
      </p>
      <p>
        <a href="#!">
          <UserOutlined className="MR10" />
          标签
        </a>
      </p>
      <p>
        <a href="#!">
          <UserOutlined className="MR10" />
          项目管理
        </a>
      </p>
      <p>
        <a href="#!">
          <UserOutlined className="MR10" />
          安全管控
        </a>
      </p>
      <Divider style={{background:'#2a2c39',margin:'10px 0'}}/>
      <p>
        <a href="#!">
          <UserOutlined className="MR10" />
          导航偏好设置
        </a>
      </p>
      <p>
        <a href="#!">
          <UserOutlined className="MR10" />
          我的积分
        </a>
      </p>
      <Divider style={{background:'#2a2c39',margin:'10px 0'}}/> */}
      <p >
        <a href="#!" onClick={handleOutLogin}>
          <UserOutlined className="MR10" />
          退出
        </a>
      </p>
    </div>
  );
};

export default personContent;
